//
//  UIButton+My.m
//  CSC
//
//  Created by mac on 15/10/22.
//
//

#import "UIButton+My.h"

@implementation UIButton (My)

/**
 *  交换图片和文字的左右位置
 */
- (void)changeImageAndTitlePlaceLR{
    CGFloat imageViewWidth = CGRectGetWidth(self.imageView.frame);
    CGFloat labelWidth = CGRectGetWidth(self.titleLabel.frame);
    [self setTitleEdgeInsets:UIEdgeInsetsMake(0, -imageViewWidth, 0, imageViewWidth)];
    [self setImageEdgeInsets:UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth)];
}

- (void)changeImageAndTitlePlace{
    
    [self changeImageAndTitlePlaceLR];
    
}

@end
